package com.qdxwx.models.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author ZhiYong
 * @updateTime 2022/4/24 22:27
 * @description 订单资金分配明细
 */
public class OrderAllotDetail implements Serializable {

    private static final long serialVersionUID = -6478046622060529786L;

    private int id;
    /**
     * 订单id
     */
    private int orderId;
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 订单金额，这里的订单金额=订单的支付金额payAmount
     */
    private int payAmount;
    /**
     * 0=用户；1=机构
     */
    private Integer accountType;
    /**
     * 账户id(0=userId;1=机构id)
     */
    private Long accountId;
    /**
     * 账户名称(0=userName;1=companyName)
     */
    private String accountName;
    /**
     * 分配比例
     */
    private int allotRate;
    /**
     * 分配金额
     */
    private int allotAmount;
    /**
     * 备注
     */
    private String remark;
    /**
     * 时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public int getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(int payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getAccountType() {
        return accountType;
    }

    public void setAccountType(Integer accountType) {
        this.accountType = accountType;
    }

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public int getAllotRate() {
        return allotRate;
    }

    public void setAllotRate(int allotRate) {
        this.allotRate = allotRate;
    }

    public int getAllotAmount() {
        return allotAmount;
    }

    public void setAllotAmount(int allotAmount) {
        this.allotAmount = allotAmount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "OrderAllotDetail{" +
                "id=" + id +
                ", orderId=" + orderId +
                ", orderNo='" + orderNo + '\'' +
                ", payAmount=" + payAmount +
                ", accountType=" + accountType +
                ", accountId=" + accountId +
                ", accountName='" + accountName + '\'' +
                ", allotRate=" + allotRate +
                ", allotAmount=" + allotAmount +
                ", remark='" + remark + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
